import Swiper from '../../components/swiper/index.jsx'
import Tabbar from '../../components/Tabbar/index.jsx'
import PullRefreshList from '../../components/pullRefreshList/index.jsx'
import BackToTop from '../../components/backTop/index.jsx'
import {useState,useEffect} from 'react'
import request from '../../utils/request.jsx'

const Home= () => {
    const [data, setData] = useState([])
    useEffect(() => {
        getDate()
    }, [])
    const getDate = async() => {
        let {data} = await request.get('/productDetails')
        data&&setData(data)
    }
    return (
        <div>
            <Swiper/>
            <PullRefreshList data={data}/>
            <BackToTop />
            <Tabbar/>
        </div>
     
    )
}

export default Home;